#ifndef RLEFilter_First
#ifdef __GNUG__
#pragma interface
#endif
#define RLEFilter_First

#include "StreamBuf.h"

class Stream;

//---- RLEFilter  --------------------------------------------------------------

class RLEFilter : public StreamBuf {
protected:
	int count, value;

protected:
	RLEFilter()
		{ count= 0; }
};

//---- RLEEncoder  -------------------------------------------------------------

class RLEEncoder : public RLEFilter {
	byte buf[130];
	int rep;
public:
	RLEEncoder();
	void Flush();
	int Overflow(u_char *bp, int size);
	void Close();
};

//---- RLEDecoder  -------------------------------------------------------------

class RLEDecoder : public RLEFilter {
	bool compat, repeat;
public:
	RLEDecoder(bool compatible= FALSE);
	int Underflow(u_char *bp, int size);
};

#endif

